<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type='text/javascript' src='resource/js/md5.js'></script>
	<script type='text/javascript' src='resource/js/jquery-1.9.1.min.js'></script>
  </head>
  
<body>
<form action="<%=basePath%>/UserAction">
	<table>
		<tr>
			<th>用户名：</th><td><input type="text" name="userName" id="userName"/></td>
		</tr>
		<tr>
			<th>密码：</th><td><input type="password" name="passwd" id="passwd"/></td>
		</tr>
		<tr >
			<th rowspan="2">
				<input type="submit" value="load" onclick="return validate();"/>
				<input type="hidden" name="op" value="LO">
			</th>
		</tr>
	</table>
</form>
<script type="text/javascript">
function validate(){
	var userName = $("#userName").val();
	var passwd = $("#passwd").val();
	if(userName == ''){
		alert("用户名不能为空！");
		return false;
	}
	if(passwd == ''){
		alert("密码不能为空！");
		return false;
	}
	$("#passwd").val(hex_md5(passwd));
}
</script>  
</body>
</html>